-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix DeprecationWarning when importing ABCs. #669
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mkcor! 💃
FWIW @T4rk1n has already fixed this in dash-component-system which will replace this soon - using a slightly different syntax if six.PY2
which I think is a tiny bit nicer than try/except
but that's not a big deal. https://github.com/plotly/dash-component-system/pull/1/files?file-filters%5B%5D=.cfg&file-filters%5B%5D=.in&file-filters%5B%5D=.js&file-filters%5B%5D=.json&file-filters%5B%5D=.py&file-filters%5B%5D=.txt#diff-b0f807d3cdecee9850589937afdc1dc1R25
@alexcjohnson I agree that the |
75785c7
to
2ec84b7
Compare
Ah, of course, now |
Oh that must be why he used |
I used Lines 46 to 49 in 0812b1a
|
0cb0805
to
ef95c92
Compare
I'm also curious because I'm not able to run RuntimeError: generator raised StopIteration
************* Module dash.development.base_component
F: 1, 0: <class 'RuntimeError'>: generator raised StopIteration (astroid-error) |
b9f19a1
to
b19c2c4
Compare
In the end, I silenced these |
@mkcor I hadn't noticed this before, but @T4rk1n's comment points to our util function dash/dash/development/base_component.py Line 66 in b19c2c4
So rather than duplicating, you could just use it again: MutableSequence = patch_collections_abc('MutableSequence') @T4rk1n OK I understand what you did, but would you agree it's nicer to avoid |
Yes, avoid if you want auto-completion and more clarity. What I wanted to avoid was the exception based solution. |
@alexcjohnson oh, yes, sorry, somehow I didn't read @T4rk1n's comment carefully either! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💃 Thanks @mkcor!
Hi,
I'm addressing the warning I get whenever I run the tests locally:
I have just transposed plotly/plotly.py#1417 to this repo.